package com.tempjob.common.businesss.mongo.entity;

import com.anwen.mongo.annotation.ID;
import com.anwen.mongo.annotation.collection.CollectionField;
import com.anwen.mongo.annotation.collection.CollectionName;
import com.anwen.mongo.enums.FieldFill;
import com.anwen.mongo.enums.IdTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 系统日志
 *
 * @TableName sys_log
 */
@CollectionName(value = "sys_admin_log")
@Data
public class SysAdminLog implements Serializable {

    @ID(type = IdTypeEnum.OBJECT_ID)
    @CollectionField("_id")
    private String id;

    @CollectionField(value = "user_id")
    @ApiModelProperty("用户id")
    private String userId;

    @CollectionField(value = "username")
    @ApiModelProperty("用户名")
    private String username;

    @CollectionField(value = "token")
    @ApiModelProperty("token")
    private String token;

    @CollectionField(value = "operation")
    @ApiModelProperty("用户操作")
    private String operation;

    @CollectionField(value = "time")
    @ApiModelProperty("响应时间")
    private Integer time;

    @CollectionField(value = "method")
    @ApiModelProperty("请求方法")
    private String method;

    @CollectionField(value = "url")
    @ApiModelProperty("url")
    private String url;

    @CollectionField(value = "params")
    @ApiModelProperty("请求参数")
    private String params;

    @CollectionField(value = "response")
    @ApiModelProperty("响应结果")
    private String response;

    @CollectionField(value = "ip")
    @ApiModelProperty("IP地址")
    private String ip;

    @CollectionField(value = "create_time", fill = FieldFill.INSERT)
    @ApiModelProperty("创建时间")
    private Date createTime;

    @CollectionField(exist = false)
    private static final long serialVersionUID = 1L;
}
